package tk.jfree.example.es.api.pagehelper;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.elasticsearch.search.aggregations.Aggregations;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl;

import java.io.Serializable;
import java.util.List;

/**
 * @author Cheng.Wei
 */
public class PageHelper<T> extends AggregatedPageImpl<T> {
    public PageHelper(List<T> content) {
        super(content);
    }

    public PageHelper(List<T> content, float maxScore) {
        super(content, maxScore);
    }

    public PageHelper(List<T> content, String scrollId) {
        super(content, scrollId);
    }

    public PageHelper(List<T> content, String scrollId, float maxScore) {
        super(content, scrollId, maxScore);
    }

    public PageHelper(List<T> content, Pageable pageable, long total) {
        super(content, pageable, total);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, float maxScore) {
        super(content, pageable, total, maxScore);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, String scrollId) {
        super(content, pageable, total, scrollId);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, String scrollId, float maxScore) {
        super(content, pageable, total, scrollId, maxScore);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, Aggregations aggregations) {
        super(content, pageable, total, aggregations);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, Aggregations aggregations, float maxScore) {
        super(content, pageable, total, aggregations, maxScore);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, Aggregations aggregations, String scrollId) {
        super(content, pageable, total, aggregations, scrollId);
    }

    public PageHelper(List<T> content, Pageable pageable, long total, Aggregations aggregations, String scrollId, float maxScore) {
        super(content, pageable, total, aggregations, scrollId, maxScore);

    }

    private Highlight snipplets;
    @Getter
    @Setter
    @Builder
    @ToString
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Highlight implements Serializable {
        private String field;
        private List<String> snipplets;
    }
}
